/**
 * 
 */
package tests.board;

import java.util.ArrayList;

import junit.framework.TestCase;
import root.JChess;
import root.board.EmptyPlaceException;
import root.board.moviment.Moviment;
import root.board.moviment.Position;
import root.board.pieces.Tower;

/**
 * @author Calebe
 * 
 */
public class GetEnabledMovimentsTower extends TestCase {
	JChess jchess;

	public void testFreetower() {
		jchess = new JChess();
		jchess.getTabuleiro()[4][4] = new Tower();
		if (jchess.isPiecePresent(new Position(4, 4))) {
			try {
				assertEquals(14, jchess.getEnabledMoviments(4, 4).size());
			} catch (EmptyPlaceException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	public void testTowerStartPosition() {
		jchess = new JChess();
		jchess.newGame();
		Position towerPosition = new Position(0, 0);
		ArrayList<Moviment> moviments = new ArrayList<Moviment>();
		if (jchess.isPiecePresent(towerPosition)) {
			try {
				moviments = jchess.getEnabledMoviments(towerPosition);
			} catch (EmptyPlaceException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		assertEquals(0, moviments.size());
	}

}
